<?php

declare(strict_types=1);

namespace DreamCat\ObjectValidTest\Helper;

use Attribute;
use DreamCat\ObjectValid\Annotation\NumberScope;
use DreamCat\ObjectValid\Annotation\Pattern;
use DreamCat\ObjectValid\Annotation\Size;
use JetBrains\PhpStorm\Immutable;

/**
 * 示例类
 * @author vijay
 */
#[Attribute]
class DemoPojo
{
    use SimpleBuilder;

    #[NumberScope(max: 55, min: 15)]
    #[Immutable]
    #[DemoPojo]
    private int $value;

    #[NumberScope(max: 38, message: "太大了")]
    private int $withMsgInt;

    #[Pattern("#a#")]
    public string $str;

    #[Pattern("#a#", "bbc")]
    #[Size(sizeMin: 3, sizeMax: 6, message: "aa")]
    public string $withMsgStr;

    #[Size(sizeMin: 1, sizeMax: 5)]
    public array $ary;

    public function testFn(DemoPojo $demoPojo, #[NumberScope(max: 30)] int $v)
    {

    }
}

# end of file
